//
//  ZCMechanismCell.m
//  zctx
//
//  Created by 郭亚京 on 15/10/12.
//  Copyright © 2015年 sanliang. All rights reserved.
//

#import "ZCMechanismCell.h"

@implementation ZCMechanismCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.imageViewIcon];
        [self.imageViewIcon mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView.centerY);
            make.left.mas_equalTo(@(20));
            make.height.mas_equalTo(@(80));
            make.width.mas_equalTo(@(80));
        }];
        
        [self.contentView addSubview:self.labelName];
        [self.labelName mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(@(20));
            make.left.mas_equalTo(@(120));
            make.height.mas_equalTo(@(20));
            make.width.equalTo(self.contentView.width).with.offset(-140);
        }];
        
        [self.contentView addSubview:self.labelContent];
        [self.labelContent mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(@(10));
            make.left.mas_equalTo(@(120));
            make.bottom.mas_equalTo(@(20));
            make.width.equalTo(self.contentView.width).with.offset(-140);
        }];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    
}

#pragma mark - instance

- (UIImageView *)imageViewIcon {
    if (!_imageViewIcon) {
        _imageViewIcon = [[UIImageView alloc] init];
    }
    return _imageViewIcon;
}

- (UILabel *)labelName {
    if (!_labelName) {
        _labelName = [[UILabel alloc] init];
        _labelName.font = [UIFont systemFontOfSize:17];
    }
    return _labelName;
}

- (UILabel *)labelContent {
    if (!_labelContent) {
        _labelContent = [[UILabel alloc] init];
        [_labelContent setTextColor:[UIColor colorWithHexString:@"cccccc"]];
        _labelContent.font = [UIFont systemFontOfSize:15];
        _labelContent.numberOfLines = 3;
    }
    return _labelContent;
}

- (UIButton *)buttonSelect {
    if (!_buttonSelect) {
        _buttonSelect = [UIButton buttonWithType:UIButtonTypeCustom];
    }
    return _buttonSelect;
}

@end
